/*==============================================================*/
/* DBMS name:      Microsoft SQL Server 2005                    */
/* Created on:     15/06/2012 11:58:20 p.m.                     */
/*==============================================================*/

create database calendarizacion

if exists (select 1
            from  sysobjects
           where  id = object_id('AULA')
            and   type = 'U')
   drop table AULA
go

if exists (select 1
            from  sysobjects
           where  id = object_id('CARRERA')
            and   type = 'U')
   drop table CARRERA
go

if exists (select 1
            from  sysobjects
           where  id = object_id('CATEDRATICO')
            and   type = 'U')
   drop table CATEDRATICO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('CATEGORIA')
            and   type = 'U')
   drop table CATEGORIA
go

if exists (select 1
            from  sysobjects
           where  id = object_id('CICLO')
            and   type = 'U')
   drop table CICLO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('COMPETENCIA')
            and   type = 'U')
   drop table COMPETENCIA
go

if exists (select 1
            from  sysobjects
           where  id = object_id('CURSO')
            and   type = 'U')
   drop table CURSO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('EDIFICIO')
            and   type = 'U')
   drop table EDIFICIO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('FACULTAD')
            and   type = 'U')
   drop table FACULTAD
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HORARIO_AULA')
            and   type = 'U')
   drop table HORARIO_AULA
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HORARIO_CARRERA')
            and   type = 'U')
   drop table HORARIO_CARRERA
go

if exists (select 1
            from  sysobjects
           where  id = object_id('HORARIO_CATEDRATICO')
            and   type = 'U')
   drop table HORARIO_CATEDRATICO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('LABORATORIO')
            and   type = 'U')
   drop table LABORATORIO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('PENSUM')
            and   type = 'U')
   drop table PENSUM
go

if exists (select 1
            from  sysobjects
           where  id = object_id('PROFESION')
            and   type = 'U')
   drop table PROFESION
go

if exists (select 1
            from  sysobjects
           where  id = object_id('TITULO')
            and   type = 'U')
   drop table TITULO
go

/*==============================================================*/
/* Table: AULA                                                  */
/*==============================================================*/
create table AULA (
   ID_AULA              int                  not null,
   constraint PK_AULA primary key (ID_AULA)
)
go

/*==============================================================*/
/* Table: CARRERA                                               */
/*==============================================================*/
create table CARRERA (
   ID_CARRERA           int                  not null,
   constraint PK_CARRERA primary key (ID_CARRERA)
)
go

/*==============================================================*/
/* Table: CATEDRATICO                                           */
/*==============================================================*/
create table CATEDRATICO (
   ID_CATEDRATICO       int                  not null,
   constraint PK_CATEDRATICO primary key (ID_CATEDRATICO)
)
go

/*==============================================================*/
/* Table: CATEGORIA                                             */
/*==============================================================*/
create table CATEGORIA (
   ID_CATEGORIA         int                  not null,
   constraint PK_CATEGORIA primary key (ID_CATEGORIA)
)
go

/*==============================================================*/
/* Table: CICLO                                                 */
/*==============================================================*/
create table CICLO (
   ID_CICLO             int                  not null,
   constraint PK_CICLO primary key (ID_CICLO)
)
go

/*==============================================================*/
/* Table: COMPETENCIA                                           */
/*==============================================================*/
create table COMPETENCIA (
   ID_COMPETENCIA       int                  not null,
   constraint PK_COMPETENCIA primary key (ID_COMPETENCIA)
)
go

/*==============================================================*/
/* Table: CURSO                                                 */
/*==============================================================*/
create table CURSO (
   ID_CURSO             int                  not null,
   constraint PK_CURSO primary key (ID_CURSO)
)
go

/*==============================================================*/
/* Table: EDIFICIO                                              */
/*==============================================================*/
create table EDIFICIO (
   ID_EDIFICIO          int                  not null,
   constraint PK_EDIFICIO primary key (ID_EDIFICIO)
)
go

/*==============================================================*/
/* Table: FACULTAD                                              */
/*==============================================================*/
create table FACULTAD (
   ID_FACULTAD          int                  not null,
   constraint PK_FACULTAD primary key (ID_FACULTAD)
)
go

/*==============================================================*/
/* Table: HORARIO_AULA                                          */
/*==============================================================*/
create table HORARIO_AULA (
   ID_HRAULA            int                  not null,
   constraint PK_HORARIO_AULA primary key (ID_HRAULA)
)
go

/*==============================================================*/
/* Table: HORARIO_CARRERA                                       */
/*==============================================================*/
create table HORARIO_CARRERA (
   ID_HRCARRERA         int                  not null,
   constraint PK_HORARIO_CARRERA primary key (ID_HRCARRERA)
)
go

/*==============================================================*/
/* Table: HORARIO_CATEDRATICO                                   */
/*==============================================================*/
create table HORARIO_CATEDRATICO (
   ID_HRCATEDRATICO     int                  not null,
   constraint PK_HORARIO_CATEDRATICO primary key (ID_HRCATEDRATICO)
)
go

/*==============================================================*/
/* Table: LABORATORIO                                           */
/*==============================================================*/
create table LABORATORIO (
   ID_LABORATORIO       int                  not null,
   constraint PK_LABORATORIO primary key (ID_LABORATORIO)
)
go

/*==============================================================*/
/* Table: PENSUM                                                */
/*==============================================================*/
create table PENSUM (
   ID_PENSUM            int                  not null,
   constraint PK_PENSUM primary key (ID_PENSUM)
)
go

/*==============================================================*/
/* Table: PROFESION                                             */
/*==============================================================*/
create table PROFESION (
   ID_PROFESION         int                  not null,
   constraint PK_PROFESION primary key (ID_PROFESION)
)
go

/*==============================================================*/
/* Table: TITULO                                                */
/*==============================================================*/
create table TITULO (
   ID_TITULO            int                  not null,
   constraint PK_TITULO primary key (ID_TITULO)
)
go

